<template>
  <div>
    <el-form label-width="120px">
      <el-form-item label="时间戳转化:">
        count.parseTime("{y}-{m}-{d} {h}:{i}:{s}") :<br />
        ===>>{{ (count||0).parseTime("{y}-{m}-{d} {h}:{i}:{s}") }}
      </el-form-item>
      <el-form-item label="千分符:">
        count.thousandsSeparator() :<br />
        ===>>{{ (count||0).thousandsSeparator() }}
      </el-form-item>
      <el-form-item label="相加运算:">
        count.add(10) :<br />
        ===>>{{ (count||0).add(10) }}
      </el-form-item>
      <el-form-item label="相减运算:">
        count.reduce(10) :<br />
        ===>>{{ (count||0).reduce(10) }}
      </el-form-item>
      <el-form-item>
        <el-input v-model.number="count" type="number" placeholder="请输入内容">
          <template #prepend>count:</template>
          <template #suffix>
            <i class="el-icon-edit el-input__icon" @click="reset"> </i>
          </template>
        </el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="reset">重置</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script lang="ts">
import {ref} from 'vue'
export default {
    setup() {
       
        const count = ref(0);
        const reset = ()=>{
            const timestamp = (new Date()).getTime();
            count.value = timestamp;
        }
        reset();
        return {
            count,
            reset
        }
    }
}
</script>
